<template>
  <!--收件箱-->
  <el-table ref="multipleTable" :data="tableData" border style="width: 800px" @selection-change="handleSelectionChange">
    <el-table-column prop="DisplayName" label="发件人昵称" width="200">
    </el-table-column>
    <el-table-column prop="Address" label="发件人邮箱地址" width="200">
    </el-table-column>
    <el-table-column prop="Subject" label="邮箱标题" width="200">
    </el-table-column>
    <el-table-column prop="Date" label="发件时间" width=" 200">
    </el-table-column>
    <el-table-column v-if="show" prop="BodyHtmlText" label="内容" width="200">
    </el-table-column>
    <el-table-column fixed="right" label="操作" width="200">
      <template slot-scope="scope">
        <el-button type="primary" @click="handleClick(scope.row)" size="small">查看</el-button>
      </template>
    </el-table-column>
    <el-dialog title="邮件内容" :visible.sync="MailConent">
      <div v-html="Body">

      </div>
    </el-dialog>
  </el-table>
</template>
<script>
export default {
  data () {
    return {
      tableData: [{
        Address: null,
        Subject: null,
        multipleSelection: [],
        show: false
      }]
    }
  }, methods: {
    handleClick (row) {
      this.MailConent = true
      this.Body = row.BodyHtmlText
    }
  },
  mounted () {
    this.$axios({
      url: '/HrApi/Mail/Mail',
      method: 'Get'
    }).then(res => {
      this.tableData = res.data.data
    })
  }
}
</script>